﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Satrabel.HttpModules.Config;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Security;
using Satrabel.Services.Log.UrlLog;
using DotNetNuke.Entities.Tabs;
using System.Collections.Generic;
using DotNetNuke.Common;
using Satrabel.Services.WebsiteAudit;

namespace Satrabel.Modules.OpenUrlRewriter
{
    public partial class Pages_View : PortalModuleBase
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            ShowPages();

        }

        private void ShowPages()
        {
            var pages = WebsiteAuditUtils.PageCheck(PortalId);   

            gvPages.DataSource = pages.OrderBy(p => p.Culture).ThenBy(p => p.TabName);
            gvPages.DataBind();
        }

        protected string EditPageSettings(object oTabId)
        {
            var editUrl = Globals.NavigateURL("Tab", "Action="+oTabId.ToString());
            if (ModuleContext.PortalSettings.EnablePopUps)
            {
                editUrl = ModuleContext.NavigateUrl(TabId, "Tab", false, "Action=Edit" );
                //editUrl = UrlUtils.PopUpUrl(editUrl, this, ModuleContext.PortalSettings, true, false);
            }
            return editUrl;
        }
    
    }
}